package com.xhg.mqtt.constant;

/**
 * 常量
 *
 * @version 1.0
 * @Description
 * @date 2017年05月24日
 * @updateby
 * @updatedate
 * @since 1.0
 */
public class MqttConstants {

    /**
     * qos_0 发送者只发送一次消息，不进行重试，Broker不会返回确认消息。在Qos0情况下，Broker可能没有接受到消息
     * qos_1发送者最少发送一次消息，确保消息到达Broker，Broker需要返回确认消息PUBACK。在Qos1情况下，Broker可能接受到重复消息
     * qos_2 使用两阶段确认来保证消息的不丢失和不重复。在Qos2情况下，Broker肯定会收到消息，且只收到一次
     */
    public final static int QOS = 1;

    public final static boolean RETAINED_FALSE = false;

    public final static boolean RETAINED_TRUE = true;

    public final static String TOPC_ACK = "ack";

    /**
     * 线程池设置
     */
    public final static int COREPOOLSIZE = 2;

    public final static int MAXIMUMPOOLSIZE = 4;

    public final static int KEEPALIVETIME = 600;

    public final static int CAPACITY = 300;
    //等待10秒开始执行
    public final static int INIT_START = 10;
    //每隔10秒执行一次
    public final static int PERIOD = 10;

    /**
     * 证书
     */
    public final static String CAPATH = "/mycert/CA/cacert.pem";

    public final static String CRTPATH = "/mycert/cert/cert-pkcs8.pem";

    public final static String KEYPATH = "/mycert/cert/client-key-pkcs8.pem";

    public final static String PWD = "brt123";

    /**
     * 认证方式
     */
    public final static int AUTH_NONE = 0;
    public final static int AUTH_CRTPA = 1;
    public final static int AUTH_USERPWD = 2;



}